/**
 * 版权所有（c）2021. 上海海鼎信息工程股份有限公司，保留所有权利
 */
package com.lovely602.design.structure.flyweight;

/**
 * 具体享元角色
 *
 * @author lizhixing
 */
public class ConcreteFlyweight implements Flyweight {

  private String key;

  ConcreteFlyweight(String key) {
    this.key = key;
    System.out.println("具体享元" + key + "被创建！");
  }

  @Override
  public void operation(UnsharedConcreteFlyweight state) {
    System.out.print("具体享元" + key + "被调用，");
    System.out.println("非享元信息是:" + state.getInfo());
  }
}
